home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-10-14 | 38.9 KB | 1,063 lines |
- Newsgroups: comp.sources.misc
- X-UNIX-From: dvadura@watdragon.waterloo.edu
- subject: v15i068: dmake version 3.6 (part 16/25)
- from: Dennis Vadura <dvadura@watdragon.waterloo.edu>
- Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
-
- Posting-number: Volume 15, Issue 68
- Submitted-by: Dennis Vadura <dvadura@watdragon.waterloo.edu>
- Archive-name: dmake-3.6/part16
-
- #!/bin/sh
- # this is part 16 of a multipart archive
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file man/dmake.nc continued
- #
- CurArch=16
- if test ! -r s2_seq_.tmp
- then echo "Please unpack part 1 first!"
- exit 1; fi
- ( read Scheck
- if test "$Scheck" != $CurArch
- then echo "Please unpack part $Scheck next!"
- exit 1;
- else exit 0; fi
- ) < s2_seq_.tmp || exit 1
- echo "x - Continuing file man/dmake.nc"
- sed 's/^X//' << 'SHAR_EOF' >> man/dmake.nc
- X re-read by dmake)
- X
- X -P# On systems that support multi-processing cause dmake to
- X use # concurrent child processes to make targets. See
- X the "MULTI PROCESSING" section for more information.
- X
- X -q Check and see if the target is up to date. Exits with
- X code 0 if up to date, 1 otherwise.
- X
- X -r Tells dmake not to read the initial startup makefile,
- X see STARTUP section for more details.
- X
- X -s Tells dmake to do all its work silently and not echo
- X the commands it is executing to stdout (also suppresses
- X warnings). This is equivalent to the .SILENT attri-
- X bute or macro.
- X
- X
- X
- X
- X
- XVersion 3.50 UW 2
- X
- X
- X
- X
- XDMAKE(p) Unsupported Software DMAKE(p)
- X
- X
- X
- X -S Force sequential execution of recipes on architectures
- X which support concurrent makes. For backward compati-
- X bility with old makefiles that have nasty side-effect
- X prerequisite dependencies.
- X
- X -t Causes dmake to touch the targets and bring them up to
- X date without executing any commands.
- X
- X -T Tells dmake to not perform transitive closure on the
- X inference graph.
- X
- X -u Force an unconditional update. (ie. do everything that
- X would be done if everything that a target depended on
- X was out of date)
- X
- X -v Verbose flag, when making targets print to stdout what
- X we are going to make and what we think it's timestamp
- X is.
- X
- X -V Print the version of dmake, and values of builtin mac-
- X ros.
- X
- X -x Upon processing the user makefile export all non-
- X internally defined macros to the user's environment.
- X This option together with the -e option allows SYSV
- X AUGMAKE recursive makes to function as expected.
- X
- XINDEX
- X Here is a list of the sections that follow and a short
- X description of each. Perhaps you won't have to read the
- X whole man page to find what you need.
- X
- X STARTUP Describes dmake initialization.
- X
- X SYNTAX Describes the syntax of makefile expres-
- X sions.
- X
- X ATTRIBUTES Describes the notion of attributes and
- X how they are used when making targets.
- X
- X MACROS Defining and expanding macros.
- X
- X RULES AND TARGETS How to define targets and their prere-
- X quisites.
- X
- X RECIPES How to tell dmake how to make a target.
- X
- X TEXT DIVERSIONS How to use text diversions in recipes and
- X macro expansions.
- X
- X SPECIAL TARGETS Some targets are special.
- X
- X
- X
- X
- XVersion 3.50 UW 3
- X
- X
- X
- X
- XDMAKE(p) Unsupported Software DMAKE(p)
- X
- X
- X
- X SPECIAL MACROS Macros used by dmake to alter the pro-
- X cessing of the makefile, and those
- X defined by dmake for the user.
- X
- X CONTROL MACROS Itemized list of special control macros.
- X
- X RUN-TIME MACROS Discussion of special run-time macros
- X such as $@ and $<.
- X
- X FUNCTION MACROS GNU style function macros, only $(mktmp
- X ...) for now.
- X
- X DYNAMIC PREREQUISITES
- X Processing of prerequisites which contain
- X macro expansions in their name.
- X
- X BINDING TARGETS The rules that dmake uses to bind a tar-
- X get to an existing file in the file sys-
- X tem.
- X
- X PERCENT(%) RULES Specification of recipes to be used by
- X the inference algorithm.
- X
- X MAKING INFERENCES The rules that dmake uses when inferring
- X how to make a target which has no expli-
- X cit recipe. This and the previous sec-
- X tion are really a single section in the
- X text.
- X
- X MAKING TARGETS How dmake makes targets other than
- X libraries.
- X
- X MAKING LIBRARIES How dmake makes libraries.
- X
- X MULTI PROCESSING Discussion of dmake's parallel make
- X facilities for architectures that support
- X them.
- X
- X CONDITIONALS Conditional expressions which control the
- X processing of the makefile.
- X
- X EXAMPLES Some hopefully useful examples.
- X
- X COMPATIBILITY How dmake compares with previous versions
- X of make.
- X
- X LIMITS Limitations of dmake.
- X
- X PORTABILITY Comments on writing portable makefiles.
- X
- X FILES Files used by dmake.
- X
- X
- X
- X
- XVersion 3.50 UW 4
- X
- X
- X
- X
- XDMAKE(p) Unsupported Software DMAKE(p)
- X
- X
- X
- X SEE ALSO Other related programs, and man pages.
- X
- X AUTHOR The guy responsible for this thing.
- X
- X BUGS Hope not.
- X
- XSTARTUP
- X When dmake begins execution it first processes the command
- X line and then processes an initial startup-makefile. This
- X is followed by an attempt to locate and process a user sup-
- X plied makefile. The startup file defines the default values
- X of all required control macros and the set of default rules
- X for making inferences. When searching for the startup
- X makefile, dmake searches the following locations, in order,
- X until a startup file is located:
- X
- X 1. The location given as the value of the macro MAK-
- X ESTARTUP defined on the command line.
- X
- X 2. The location given as the value of the environment
- X variable MAKESTARTUP defined in the current
- X environment.
- X
- X 3. The location given as the value of the macro MAK-
- X ESTARTUP defined internally within dmake.
- X
- X The above search is disabled by specifying the -r option on
- X the command line. An error is issued if a startup makefile
- X cannot be found and the -r option was not specified. A user
- X may substitute a custom startup file by defining the MAKES-
- X TARTUP environment variable or by redefining the MAKESTARTUP
- X macro on the command line. To determine where dmake looks
- X for the default startup file, check your environment or
- X issue the command "dmake -V".
- X
- X A similar search is performed to locate a default user
- X makefile when no -f command line option is specified. The
- X special target .MAKEFILES is defined by default. This
- X target's prerequisite list specifies the names of files and
- X the order that dmake will use to search for them when
- X attempting to locate the default makefile. A typical defin-
- X ition for this target is:
- X
- X .MAKEFILES : makefile.mk Makefile makefile
- X
- X dmake will first look for makefile.mk and then the others.
- X If a prerequisite cannot be found dmake will try to make it
- X before going on to the next prerequisite. For example,
- X makefile.mk can be checked out of an RCS file if the proper
- X rules for doing so are defined in the startup file.
- X
- X
- X
- X
- X
- XVersion 3.50 UW 5
- X
- X
- X
- X
- XDMAKE(p) Unsupported Software DMAKE(p)
- X
- X
- X
- XSYNTAX
- X This section is a summary of the syntax of makefile state-
- X ments. The description is given in a style similar to BNF,
- X where { } enclose items that may appear zero or more times,
- X and [ ] enclose items that are optional. Alternative pro-
- X ductions for a left hand side are indicated by '->', and
- X newlines are significant. All symbols in bold type are text
- X or names representing text supplied by the user.
- X
- X
- X
- X Makefile -> { Statement }
- X
- X Statement -> Macro-Definition
- X -> Conditional
- X -> Rule-Definition
- X -> Attribute-Definition
- X
- X Macro-Definition -> MACRO = LINE
- X -> MACRO *= LINE
- X -> MACRO := LINE
- X -> MACRO *:= LINE
- X -> MACRO += LINE
- X -> MACRO +:= LINE
- X
- X Conditional -> .IF expression
- X Makefile
- X [ .ELSE
- X Makefile ]
- X .END
- X
- X expression -> LINE
- X -> STRING == LINE
- X -> STRING != LINE
- X
- X
- X Rule-Definition -> target-definition
- X [ recipe ]
- X
- X target-definition -> targets [attrs] op { PREREQUISITE } [; rcp-line]
- X
- X targets -> target { targets }
- X -> "target" { targets }
- X
- X target -> special-target
- X -> TARGET
- X
- X attrs -> attribute { attrs }
- X -> "attribute" { attrs }
- X
- X op -> : { modifier }
- X
- X
- X
- X
- XVersion 3.50 UW 6
- X
- X
- X
- X
- XDMAKE(p) Unsupported Software DMAKE(p)
- X
- X
- X
- X modifier -> :
- X -> ^
- X -> !
- X -> -
- X
- X recipe -> { TAB rcp-line }
- X -> [@][%][-] [
- X { LINE }
- X ]
- X
- X rcp-line -> [@][%][-][+] LINE
- X
- X
- X Attribute-Definition -> attrs : targets
- X
- X
- X attribute -> .EPILOG
- X -> .IGNORE
- X -> .LIBRARY
- X -> .MKSARGS
- X -> .NOINFER
- X -> .PRECIOUS
- X -> .PROLOG
- X -> .SETDIR=path
- X -> .SILENT
- X -> .SEQUENTIAL
- X -> .SWAP
- X -> .USESHELL
- X -> .SYMBOL
- X -> .UPDATEALL
- X
- X special-target -> .ERROR
- X -> .EXPORT
- X -> .GROUPEPILOG
- X -> .GROUPPROLOG
- X -> .IMPORT
- X -> .INCLUDE
- X -> .INCLUDEDIRS
- X -> .MAKEFILES
- X -> .REMOVE
- X -> .SOURCE
- X -> .SOURCE.suffix
- X -> .suffix1.suffix2
- X
- X
- X Where, TAB represents a <tab> character, STRING represents
- X an arbitrary sequence of characters, and LINE represents a
- X possibly empty sequence of characters terminated by a non-
- X escaped (not immediately preceded by a backslash '\') new-
- X line character. MACRO, PREREQUISITE, and TARGET each
- X represent a string of characters not including space or tab
- X which respectively form the name of a macro, prerequisite or
- X
- X
- X
- XVersion 3.50 UW 7
- X
- X
- X
- X
- XDMAKE(p) Unsupported Software DMAKE(p)
- X
- X
- X
- X target. The name may itself be a macro expansion expres-
- X sion. A LINE can be continued over several physical lines
- X by terminating it with a single backslash character. Com-
- X ments are initiated by the pound '#' character and extend to
- X the end of line. All comment text is discarded, a '#' may
- X be placed into the makefile text by escaping it with '\'
- X (ie. \# translates to # when it is parsed). A group of con-
- X tinued lines may be commented out by placing a single # at
- X the start of the first line of the group. A continued line
- X may not span more than one makefile.
- X
- X white space is defined to be any combination of <space>,
- X <tab>, and the sequence \<nl> when \<nl> is used to ter-
- X minate a LINE. When processing macro definition lines, any
- X amount of white space is allowed on either side of the macro
- X operator (=, *=, :=, *:=, += or +:=), and white space is
- X stripped from both before and after the macro value string.
- X The sequence \<nl> is treated as white space during recipe
- X expansion and is deleted from the final recipe string. You
- X must escape the \<nl> with a \ in order to get a \ at the
- X end of a recipe line. The \<nl> sequence is deleted from
- X macro values when they are expanded.
- X
- X When processing target definition lines, the recipe for a
- X target must, in general, follow the first definition of the
- X target (See the RULES AND TARGETS section for an exception),
- X and the recipe may not span across multiple makefiles. Any
- X targets and prerequisites found on a target definition line
- X are taken to be white space separated tokens. The rule
- X operator (op in SYNTAX section) is also considered to be a
- X token but does not require white space to precede or follow
- X it. Since the rule operator begins with a `:', traditional
- X versions of make do not allow the `:' character to form a
- X valid target name. dmake allows `:' to be present in
- X target/prerequisite names as long as the entire
- X target/prerequisite name is quoted. For example:
- X
- X a:fred : test
- X
- X would be parsed as TARGET = a, PREREQUISITES are fred, :,
- X and test, which is not what was intended. To fix this you
- X must write:
- X
- X "a:fred" : test
- X
- X Which will be parsed as expected. See the EXAMPLES section
- X for how to apply this to a list of targets.
- X
- XATTRIBUTES
- X dmake defines several target attributes. Attributes may be
- X assigned to a single target, a group of targets, or to all
- X targets in the makefile. Attributes are used to modify
- X
- X
- X
- XVersion 3.50 UW 8
- X
- X
- X
- X
- XDMAKE(p) Unsupported Software DMAKE(p)
- X
- X
- X
- X dmake actions during target update. The recognized attri-
- X butes are:
- X
- X
- X .EPILOG Insert shell epilog code when executing a group
- X recipe associated with any target having this
- X attribute set.
- X
- X .IGNORE Ignore an error when trying to make any target
- X with this attribute set.
- X
- X .LIBRARY Target is a library.
- X
- X .MKSARGS If in an MSDOS environment then use MKS extended
- X argument passing conventions to pass arguments
- X to commands. Non-MSDOS environments ignore this
- X attribute.
- X
- X .NOINFER Any target with this attribute set will not be
- X subjected to transitive closure if it is
- X inferred as a prerequisite of a target whose
- X recipe and prerequisites are being inferred.
- X (i.e. the inference algorithm will not use any
- X prerequisite with this attribute set, as a tar-
- X get)
- X
- X .PRECIOUS Do not remove this target under any cir-
- X cumstances. Set by default for any targets
- X whose corresponding files exist in the file sys-
- X tem prior to the execution of dmake.
- X
- X .PROLOG Insert shell prolog code when executing a group
- X recipe associated with any target having this
- X attribute set.
- X
- X .SEQUENTIAL Force a sequential make of the associated
- X target's prerequisites.
- X
- X .SETDIR Change current working directory to specified
- X directory when making the associated target.
- X You must specify the directory at the time the
- X attribute is specified. To do this simply give
- X .SETDIR=path as the attribute. path is expanded
- X and the result is used as the value of the
- X directory to change to. If path is surrounded
- X by single quotes then path is not expanded, and
- X is used literally as the directory name. If the
- X path contains any `:' characters then the entire
- X attribute string must be quoted using ". If a
- X target having this attribute set also has the
- X .IGNORE attribute set then if the change to the
- X specified directory fails it will be ignored,
- X
- X
- X
- XVersion 3.50 UW 9
- X
- X
- X
- X
- XDMAKE(p) Unsupported Software DMAKE(p)
- X
- X
- X
- X and no error message will be issued.
- X
- X .SILENT Do not echo the recipe lines when making any
- X target with this attribute set, and do not issue
- X any warnings.
- X
- X .SWAP Under MSDOS when making a target with this
- X attribute set swap the dmake executable to disk
- X prior to executing the recipe line.
- X
- X .SYMBOL Target is a library member and is an entry point
- X into a module in the library. This attribute is
- X used only when searching a library for a target.
- X Targets of the form lib((entry)) have this
- X attribute set automatically.
- X
- X .USESHELL Force each recipe line of a target to be exe-
- X cuted using a shell. Specifying this attribute
- X is equivalent to specifying the '+' character at
- X the start of each line of a non-group recipe.
- X
- X .UPDATEALL Indicates that all the targets listed in this
- X rule are updated by the execution of the accom-
- X panying recipe. A common example is the produc-
- X tion of the y.tab.c and y.tab.h files by yacc
- X when it is run on a grammar. Specifying
- X .UPDATEALL in such a rule prevents the running
- X of yacc twice, once for the y.tab.c file and
- X once for the y.tab.h file.
- X
- X
- X All attributes are user setable and except for .UPDATEALL
- X and .MKSARGS may be used in one of two forms. The .MKSARGS
- X attribute is restricted to use as a global attribute, and
- X the use of the .UPDATEALL attribute is restricted to rules
- X of the second form only.
- X
- X ATTRIBUTE_LIST : targets
- X
- X assigns the attributes specified by ATTRIBUTE_LIST to each
- X target in targets or
- X
- X targets ATTRIBUTE_LIST : ...
- X
- X assigns the attributes specified by ATTRIBUTE_LIST to each
- X target in targets. In the first form if targets is empty
- X (ie. a NULL list), then the list of attributes will apply to
- X all targets in the makefile (this is equivalent to the com-
- X mon Make construct of ".IGNORE :" but has been modified to
- X the notion of an attribute instead of a special target).
- X Not all of the attributes have global meaning. In particu-
- X lar, .LIBRARY, .SYMBOL, and .UPDATEALL have no assigned
- X
- X
- X
- XVersion 3.50 UW 10
- X
- X
- X
- X
- XDMAKE(p) Unsupported Software DMAKE(p)
- X
- X
- X
- X global meaning.
- X
- X Any attribute may be used with any target, even with the
- X special targets. Some combinations are useless (e.g.
- X .INCLUDE .PRECIOUS: ... ), while others are useful (e.g.
- X .INCLUDE .IGNORE : "file.mk" will not complain if file.mk
- X cannot be found using the include file search rules, see the
- X section on SPECIAL TARGETS for a description of .INCLUDE).
- X If a specified attribute will not be used with the special
- X target a warning is issued and the attribute is ignored.
- X
- XMACROS
- X dmake supports six types of macro assignment.
- X
- X
- X MACRO = LINE This is the most common and familiar form of
- X macro assignment. It assigns LINE literally
- X as the value of MACRO. Future expansions of
- X MACRO recursively expand it's value.
- X
- X MACRO *= LINE This form behaves exactly as the simple '='
- X form with the exception that if MACRO
- X already has a value then the assignment is
- X not performed.
- X
- X MACRO := LINE This form differs from the simple '=' form
- X in that it expands LINE prior to assigning
- X it as the value of MACRO. Future expansions
- X of MACRO do not recursively expand it's
- X value.
- X
- X MACRO *:= LINE This form behaves exactly as the ':=' form
- X with the exception that if MACRO already has
- X a value then the assignment and expansion
- X are not performed.
- X
- X MACRO += LINE This form of macro assignment allows macro
- X values to grow. It takes the literal value
- X of LINE and appends it to the previous value
- X of MACRO separating the two by a single
- X space. Future expansions of MACRO recur-
- X sively expand it's value.
- X
- X MACRO +:= LINE This form is similar to the '+=' form except
- X that the value of LINE is expanded prior to
- X being added to the value of MACRO.
- X
- X Macro expressions specified on the command line allow the
- X macro value to be redefined within the makefile only if the
- X macro is defined using the '+=' and '+:=' operators. Other
- X operators will define a macro that cannot be further modi-
- X fied.
- X
- X
- X
- XVersion 3.50 UW 11
- X
- X
- X
- X
- XDMAKE(p) Unsupported Software DMAKE(p)
- X
- X
- X
- X When dmake defines a non-environment macro it strips leading
- X and trailing white space from the macro value. Macros
- X imported from the environment via either the .IMPORT special
- X target (see the SPECIAL TARGETS section), or the -e, or -E
- X flags are an exception to this rule. Their values are
- X always taken literally and white space is never stripped.
- X In addition, macros defined using the .IMPORT special target
- X do not have their values expanded when they are used within
- X a makefile. In contrast, environment macros that are
- X imported due to the specification of the -e or -E flags are
- X subject to expansion when used.
- X
- X To specify a macro expansion enclose the name in () or {}
- X and precede it with a dollar sign $. Thus $(TEST)
- X represents an expansion of the macro variable named TEST.
- X If TEST is defined then $(TEST) is replaced by its expanded
- X value. If TEST is not defined then $(TEST) expands to the
- X NULL string (this is equivalent to defining a macro as
- X 'TEST=' ). A short form may be used for single character
- X named macros. In this case the parentheses are optional,
- X and $(I) is equivalent to $I. Macro expansion is recursive,
- X hence, if the value string contains an expression represent-
- X ing a macro expansion, the expansion is performed. Circular
- X macro expansions are detected and cause an error to be
- X issued.
- X
- X When defining a macro the given macro name is first expanded
- X before being used to define the macro. Thus it is possible
- X to define macros whose names depend on values of other mac-
- X ros. For example, suppose
- X
- X CWD = $(PWD:b)
- X
- X is defined, then the value of $(CWD) is the name of the
- X current directory. This can be used to define macros
- X specific to this directory, for example:
- X
- X _$(CWD).prt = list of files to print...
- X
- X The actual name of the defined macro is a function of the
- X current directory. A construct such as this is useful when
- X processing a hierarchy of directories using .SETDIR attri-
- X buted targets and a collection of small distributed makefile
- X stubs.
- X
- X Macro variables may be defined within the makefile, on the
- X command line, or imported from the environment.
- X
- X dmake supports several non-standard macro expansions: The
- X first is of the form:
- X
- X
- X
- X
- X
- XVersion 3.50 UW 12
- X
- X
- X
- X
- XDMAKE(p) Unsupported Software DMAKE(p)
- X
- X
- X
- X $(macro_name:modifier_list:modifier_list:...)
- X
- X where modifier_list is chosen from the set { D or d, F or f,
- X B or b, S or s, T or t } and
- X
- X d - directory portion of all path names
- X f - file (including suffix) portion of path names
- X b - file (not including suffix) portion of path names
- X s - simple pattern substitution
- X t - tokenization.
- X
- X Thus if we have the example:
- X
- X test = d1/d2/d3/a.out f.out d1/k.out
- X
- X The following macro expansions produce the values on the
- X right of '-->' after expansion.
- X
- X $(test:d) --> d1/d2/d3/ d1/
- X $(test:b) --> a f k
- X $(test:f) --> a.out f.out k.out
- X ${test:db} --> d1/d2/d3/a f d1/k
- X ${test:s/out/in/:f} --> a.in f.in k.in
- X $(test:f:t"+") --> a.out+f.out+k.out
- X
- X If a token ends in a string composed from the value of the
- X macro DIRBRKSTR (ie. ends in a directory separator string,
- X e.g. '/' in UNIX) and you use the :d modifier then the
- X expansion returns the directory name less the final direc-
- X tory separator string. Thus successive pairs of :d modif-
- X iers each remove a level of directory in the token string.
- X
- X The tokenization modifier takes all white space separated
- X tokens from the macro value and separates them by the quoted
- X separator string. The separator string may contain the fol-
- X lowing escape codes \a => <bel>, \b => <backspace>, \f =>
- X <formfeed>, \n => <nl>, \r => <cr>, \t => <tab>, \v =>
- X <vertical tab>, \" => ", and \xxx => <xxx> where xxx is the
- X octal representation of a character. Thus the expansion:
- X
- X $(test:f:t"+\n")
- X produces:
- X a.out+
- X f.out+
- X k.out
- X
- X The second non-standard form of macro expansion allows for
- X recursive macros. It is possible to specify a $(macro_name)
- X or ${macro_name} expansion where macro_name contains more $(
- X ... ) or ${ ... } macro expansions itself.
- X
- X
- X
- X
- X
- XVersion 3.50 UW 13
- X
- X
- X
- X
- XDMAKE(p) Unsupported Software DMAKE(p)
- X
- X
- X
- X For example $(CC$(_HOST)$(_COMPILER)) will first expand
- X CC$(_HOST)$(_COMPILER) to get a result and use that result
- X as the name of the macro to expand. This is useful for
- X writing a makefile for more than one target environment. As
- X an example consider the following hypothetical case. Suppose
- X that _HOST and _COMPILER are imported from the environment
- X and are set to represent the host machine type and the host
- X compiler respectively.
- X
- X CFLAGS_VAX_CC = -c -O # _HOST == "_VAX", _COMPILER == "_CC"
- X CFLAGS_PC_MSC = -c -ML # _HOST == "_PC", _COMPILER == "_MSC"
- X
- X # redefine CFLAGS macro as:
- X
- X CFLAGS := $(CFLAGS$(_HOST)$(_COMPILER))
- X
- X This causes CFLAGS to take on a value that corresponds to
- X the environment in which the make is being invoked.
- X
- X The final non-standard macro expansion is of the form:
- X
- X string1{token_list}string2
- X
- X where string1, string2 and token_list are expanded. After
- X expansion, string1 is prepended to each token found in
- X token_list and string2 is appended to each resulting token
- X from the previous prepend. string1 and string2 are not del-
- X imited by white space whereas the tokens in token_list are.
- X A null token in the token list is specified using "". Thus
- X using another example we have:
- X
- X test/{f1 f2}.o --> test/f1.o test/f2.o
- X test/ {f1 f2}.o --> test/ f1.o f2.o
- X test/{f1 f2} .o --> test/f1 test/f2 .o
- X test/{ f1 "f2" "" }.o --> test/f1.o test/f2.o
- X test/.o
- X
- X and
- X
- X test/{ d1 d2 }/{ f1 f2 }.o --> test/d1/f1.o
- X test/d1/f2.o
- X test/d2/f1.o
- X test/d2/f2.o
- X
- X See the SPECIAL MACROS section for a description of the spe-
- X cial macros that dmake defines and understands.
- X
- XRULES AND TARGETS
- X A makefile contains a series of entries that specify depen-
- X dencies. Such entries are called target/prerequisite or
- X rule definitions. Each rule definition is optionally fol-
- X lowed by a set of lines that provide a recipe for updating
- X
- X
- X
- XVersion 3.50 UW 14
- X
- X
- X
- X
- XDMAKE(p) Unsupported Software DMAKE(p)
- X
- X
- X
- X any targets defined by the rule. Whenever dmake attempts to
- X bring a target up to date and an explicit recipe is provided
- X with a rule defining the target, that recipe is used to
- X update the target. A rule definition begins with a line
- X having the following syntax:
- X
- X <targets> [<attributes>] <ruleop> [<prerequisites>] [;<recipe>]
- X
- X targets is a non-empty list of targets. If the target is a
- X special target (see SPECIAL TARGETS section below) then it
- X must appear alone on the rule line. For example:
- X
- X .IMPORT .ERROR : ...
- X
- X is not allowed since both .IMPORT and .ERROR are special
- X targets. Special targets are not used in the construction
- X of the dependency graph and will not be made.
- X
- X attributes is a possibly empty list of attributes. Any
- X attribute defined in the ATTRIBUTES section above may be
- X specified. All attributes will be applied to the list of
- X named targets in the rule definition. No other targets will
- X be affected.
- X
- X
- X NOTE: As stated earlier, if both the target list and
- X prerequisite list are empty but the attributes list
- X is not, then the specified attributes affect all
- X targets in the makefile.
- X
- X
- X ruleop is a separator which is used to identify the targets
- X from the prerequisites. Optionally it also provides a
- X facility for modifying the way in which dmake handles the
- X making of the associated targets. In its simplest form the
- X operator is a single ':', and need not be separated by white
- X space from its neighbouring tokens. It may additionally be
- X followed by any of the modifiers { !, ^, -, : }, where:
- X
- X
- X ! says execute the recipe for the associated targets once
- X for each out of date prerequisite. Ordinarily the
- X recipe is executed once for all out of date prere-
- X quisites at the same time.
- X
- X ^ says to insert the specified prerequisites, if any,
- X before any other prerequisites already associated with
- X the specified targets. In general, it is not useful to
- X specify ^ with an empty list of prerequisites.
- X
- X - says to clear the previous list of prerequisites before
- X adding the new prerequisites. Thus,
- X
- X
- X
- XVersion 3.50 UW 15
- X
- X
- X
- X
- XDMAKE(p) Unsupported Software DMAKE(p)
- X
- X
- X
- X .SUFFIXES :
- X .SUFFIXES : .a .b
- X
- X can be replaced by
- X
- X .SUFFIXES :- .a .b
- X
- X however the old form still works as expected. NOTE:
- X .SUFFIXES is ignored by dmake it is used here simply as
- X an example.
- X
- X : When the rule operator is not modified by a second ':'
- X only one set of rules may be specified for making a
- X target. Multiple definitions may be used to add to the
- X list of prerequisites that a target depends on. How-
- X ever, if a target is multiply defined only one defini-
- X tion may specify a recipe for making the target.
- X
- X When a target's rule operator is modified by a second
- X ':' (:: for example) then this definition may not be
- X the only definition with a recipe for the target.
- X There may be other :: target definition lines that
- X specify a different set of prerequisites with a dif-
- X ferent recipe for updating the target. Any such target
- X is made if any of the definitions find it to be out of
- X date with respect to the related prerequisites and the
- X corresponding recipe is used to update the target.
- X
- X In the following simple example, each rule has a `::'
- X ruleop. In such an operator we call the first `:' the
- X operator, and the second `:' the modifier.
- X
- X a.o :: a.c b.h
- X first recipe for making a.o
- X
- X a.o :: a.y b.h
- X second recipe for making a.o
- X
- X If a.o is found to be out of date with respect to a.c
- X then the first recipe is used to make a.o. If it is
- X found out of date with respect to a.y then the second
- X recipe is used. If a.o is out of date with respect to
- X b.h then both recipes are invoked to make a.o. In the
- X last case the order of invocation corresponds to the
- X order in which the rule definitions appear in the
- X makefile.
- X
- X Targets defined using a single `:' operator with a recipe
- X may be redefined again with a new recipe by using a `:'
- X operator with a `:' modifier. This is equivalent to a tar-
- X get having been initially defined with a rule using a `:'
- X modifier. Once a target is defined using a `:' modifier it
- X
- X
- X
- XVersion 3.50 UW 16
- X
- X
- X
- X
- XDMAKE(p) Unsupported Software DMAKE(p)
- X
- X
- X
- X may not be defined again with a recipe using only the `:'
- X operator with no `:' modifier. In both cases the use of a
- X `:' modifier creates a new list of prerequisites and makes
- X it the current prerequisite list for the target. The `:'
- X operator with no recipe always modifies the current list of
- X prerequisites. Thus assuming each of the following defini-
- X tions has a recipe attached, then:
- X
- X joe : fred ... (1)
- X joe :: more ... (2)
- X
- X and
- X
- X joe :: fred ... (3)
- X joe :: more ... (4)
- X
- X are legal and mean: add the recipe associated with (2), or
- X (4) to the set of recipes for joe, placing them after exist-
- X ing recipes for making joe. The constructs:
- X
- X joe :: fred ... (5)
- X joe : more ... (6)
- X
- X and
- X
- X joe : fred ... (7)
- X joe : more ... (8)
- X
- X are errors since we have two sets of perfectly good recipes
- X for making the target.
- X
- X prerequisites is a possibly empty list of targets that must
- X be brought up to date before making the current target.
- X
- X recipe is a short form and allows the user to specify short
- X rule definitions on a single line. It is taken to be the
- X first recipe line in a larger recipe if additional lines
- X follow the rule definition. If the semi-colon is present
- X but the recipe line is empty (ie. null string) then it is
- X taken to be an empty rule. Any target so defined causes the
- X Don't know how to make ... error message to be suppressed
- X when dmake tries to make the target and fails. This silence
- X is maintained for rules that are terminated by a semicolon
- X and have no following recipe lines, for targets listed on
- X the command line, and for the first target found in the
- X makefile.
- X
- XRECIPES
- X The traditional format used by most versions of Make defines
- X the recipe lines as arbitrary strings that may contain macro
- X expansions. They follow a rule definition line and may be
- X spaced apart by comment or blank lines. The list of recipe
- X
- X
- X
- XVersion 3.50 UW 17
- X
- X
- X
- X
- XDMAKE(p) Unsupported Software DMAKE(p)
- X
- X
- X
- X lines defining the recipe is terminated by a new target
- X definition, a macro definition, or end-of-file. Each recipe
- X line MUST begin with a <TAB> character which may optionally
- X be followed with one or all of the characters '@%+-'. The
- X '-' indicates that non-zero exit values (ie. errors) are to
- X be ignored when this recipe line is executed, the '+' indi-
- X cates that the current recipe line is to be executed using
- X the shell, the '%' indicates that dmake should swap itself
- X out to secondary storage (MSDOS only) before running the
- X recipe and the '@' indicates that the recipe line should NOT
- X be echoed to the terminal prior to being executed. Each
- X switch is off by default (ie. by default, errors are signi-
- X ficant, commands are echoed, no swapping is done and a shell
- X is used only if the recipe line contains a character found
- X in the value of the SHELLMETAS macro). Global settings
- X activated via command line options or special attribute or
- X target names may also affect these settings. An example
- X recipe:
- X
- X target :
- X first recipe line
- X second recipe line, executed independently of the first.
- X @a recipe line that is not echoed
- X -and one that has errors ignored
- X %and one that causes dmake to swap out
- X +and one that is executed using a shell.
- X
- X The second and new format of the recipe block begins the
- X block with the character '[' (the open group character) in
- X the last non-white space position of a line, and terminates
- X the block with the character ']' (the close group character)
- X in the first non-white space position of a line. In this
- X form each recipe line need not have a leading TAB. This is
- X called a recipe group. Groups so defined are fed intact as
- X a single unit to a shell for execution whenever the
- X corresponding target needs to be updated. If the open group
- X character '[' is preceded by one or all of -, @ or % then
- X they apply to the entire group in the same way that they
- X apply to single recipe lines. You may also specify '+' but
- SHAR_EOF
- echo "End of part 16"
- echo "File man/dmake.nc is continued in part 17"
- echo "17" > s2_seq_.tmp
- exit 0
-
-